/**
 * For test - none view
 * 
 * @author caio thomas
 */
package main.view;

import main.KeysExecution;
import main.KeysVal;
import main.constraint.XDF;

public class InitialConsole 
{	
	private String filename = "file:///home/caio/Documents/workspace-ic/TesteWeb/contact.xml";
	//private String filename = "file:///home/caio/Documents/workspace-ic/TesteWeb/xdf.xml";

	
	private String contex = "agenda";
	private String left = "contato / id";
	private String typeLeftPath = "v";
	private String right = "contato";
	private String typeRightPath = "n";
	
	
	/*
	//para todo contexto de agenda, um endereco deve ter telefone iguais
	private String contex = "agenda";
	private String left = "contato / endereco / rua | contato / endereco / numero | contato / endereco / estado | contato / endereco / cidade ";
	private String typeLeftPath = "v,v,v,v";
	private String right = "contato / phones / fixo";
	private String typeRightPath = "v";
	*/
	
	/*
	//cada celular so pode ser associado a um endereco 
	private String contex = "agenda";
	private String left = "contato / phones / celular";
	private String typeLeftPath = "v";
	private String right = "contato / endereco";
	private String typeRightPath = "n";
	*/
	
	/*
	private String contex = "agenda";
	private String left = "contato / phones / celular";
	private String typeLeftPath = "v";
	private String right = "contato";
	private String typeRightPath = "n";	
	*/
	
	
	/*
	private String contex = "bd";
	private String left = " projet / fournisseur / composant / cnom | projet / fournisseur / fnom";
	private String typeLeftPath = "v,v";
	private String right = "projet / fournisseur / composant / quantite";
	private String typeRightPath = "v";	
	*/
	
	/*
	private String contex = "bd";
	private String left = " projet / fournisseur / fnom";
	private String typeLeftPath = "v";
	private String right = "projet / fournisseur ";
	private String typeRightPath = "n";
	*/
	
	private String kname = "xdf1";

	private KeysExecution ke = new KeysExecution();
	private KeysVal kv = new KeysVal();
	
	public InitialConsole()
	{				
		XDF k = new XDF(); 
		k.setNameConstraint(kname);
		k.setContextFsa(contex);
		k.setSourceFsa(left);
		k.setEquality(typeLeftPath,"l");
		k.setTargetFsa(right);
		k.setEquality(typeRightPath,"r");
		ke.addKeys(k);
		System.err.println("RESULT: " + kv.parseKeysVal(filename, ke));
		
		//System.out.println("Keys Execution To String " + ke.toString());
		
		kv.getErrosConstraint();
		System.out.println(kv.getResult());
		
	}
	
	
	public static void main(String[] args)
	{
		new InitialConsole();		
	}	
	
}
